package com.ruoyi.sql;

import com.baomidou.mybatisplus.annotation.TableName;

import java.util.Objects;

/**
 * **********************
 * * Author: XiaShiLong *
 * * Date  : 2021-05-14 *
 * * Time  : 13:57      *
 * * to    : lz&xm      *
 * **********************
 **/
public class TableUtil {

    public static String getTableName(Class<?> classes) {
        TableName annotation = classes.getAnnotation(TableName.class);
        if (Objects.isNull(annotation)) {
            throw new RuntimeException("TableName annotation is not find!");
        }
        return annotation.value();
    }
}
